//
//  MHCircleTagViewModel.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/4/17.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHCircleTagViewModel.h"
#import "MHCircleTag.h"

@interface MHCircleTagViewModel()
@property (nonatomic, readwrite, strong) RACCommand *requestRemoteDataCommand;


@end

@implementation MHCircleTagViewModel
- (void)initialize
{
    [super initialize];
    
    @weakify(self)
    
    RAC(self, circleTags) = self.requestRemoteDataCommand.executionSignals.switchToLatest;
    
    self.requestRemoteDataCommand = [[RACCommand alloc] initWithSignalBlock:^(id input) {
        @strongify(self)
        
        return [[[self.services.client fetchCircleAppAttrList] mh_parsedResults] takeUntil:self.rac_willDeallocSignal];
    }];
    self.requestFullCoverCommand = [[RACCommand alloc] initWithSignalBlock:^(id input) {
        @strongify(self)
        
        return [[[self.services.client fetchCircleCoverList] mh_parsedResults] takeUntil:self.rac_willDeallocSignal];
    }];
    
    
    
    
    
}
//- (NSArray *)dataSourceWithCircles:(NSArray *)circleTags {
//    if (MHObjectIsNil(circleTags) || circleTags.count == 0) return nil;
//    
//    []
////
////    NSMutableArray *viewModels = [[circleTags.rac_sequence map:^(MHCircleTag *circleTag) {
////        MHHomeCirleItemViewModel *viewModel = [[MHHomeCirleItemViewModel alloc] initWithCircle:homeCircle];
////        return viewModel;
////    }].array mutableCopy];
//    return viewModels ?: @[] ;
//}

@end
